<include file="Public:header" />



<div class="tools"> 

<div class="add"><span><a href="{:U('content/editnews')}">添加</a></span></div>

<div class="del"><span><span><a href="javascript:void(0);" onclick="del();">删除</a></span></div>

</div>

<div class="content">

<!-----------------------------------------内容开始--------------------------------------------------->

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabBox">

<tr class="tabTitleMain">

    <td width="5%" class="selectAll"><a href="javascript:;" id="selall">全选</a></td>

    <td width="5%">ID号</td>

    <td width="8%">型号</td>

    <td width="8%">图片</td>

    <td width="5%">300户</td>

    <td width="5%">500户</td>

    <td width="5%">800户</td>

    <td width="5%">1000户</td>

    <td width="10%">已参与户数</td>

    <td width="10%">操作</td>

</tr>





<volist name='list' id='l'>

<tr class="tabTextMain" id="From_1" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#fbf435';">

  <td><input type="checkbox" name="ids" id="ids" value="{$l.id}"></td>

  <td>{$l.id}</td>

  <td>{$l.name}</td>

  <td><img src="{$l.tupian}" width="80" height="80" /></td>

  <td>{$l.sanbai}</td>

  <td>{$l.wubai}</td>

  <td>{$l.babai}</td>
  <td>{$l.yiqian}</td>
  <td>{$l.renshu}</td>

  <td><a href="{:U('content/editnews',array(id=>$l[id]))}">修改</a>|<a href="javascript:;" onclick="del({$l.id});">删除</a></td>

</tr>

</volist>

  

</table> 

<div class="page">{$page}</div>

<!-----------------------------------------内容结束--------------------------------------------------->

</div>

<script type="text/javascript">   

$(function() {   

$("#selall").toggle(function() {   

     $("input[name='ids']").each(function() {   

     $(this).attr("checked", true); 

     });

},function(){

	 $("input[name='ids']").each(function() {   

     $(this).attr("checked", false); 

     }); 

});



});

function del(kid){

kid = kid ? kid : getChecked();

kid = kid.toString();

if(kid == ''){

	ui.error('你没有选择任何选项！');

	return false;

}

if(!confirm('删除后无法恢复，确定删除？'))

	return false;



$.post("{:U('content/delnews')}", {ids:kid}, function(v){

	if( v == 1 ){

		ui.success('删除成功！');

		location.reload("{:U('content/news')}");

	}else{

		ui.error('删除失败！');

	}

});

} 



function getChecked() {

var gids = new Array();

$.each($('input:checked'), function(i, n){

	gids.push( $(n).val() );

});

return gids;

}

</script>



    



<include file="Public:footer" />

